package com.example.controller;
import cn.hutool.core.map.MapUtil;
import com.example.entity.Account1;
import com.example.service.Account1Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;

/**
 * Created by IntelliJ IDEA2021.3
 * @Author: Tenghw
 * @Date: 2022/09/26  19:55
 * @Description:
 */
@RestController
public class Account1Controller {

    @Autowired
    Account1Service account1Service;

    @PostMapping("/add")
    public Map<String, Object> add(@RequestBody Account1 account1) {
        boolean b = account1Service.addAccount1(account1);
        Map<String, Object> map = MapUtil.newHashMap();
        if (b) {
            map.put("message", "注册用户成功！");
        } else {
            map.put("message", "注册用户失败！");
        }
        return map;
    }
}
